package com.xui.android

import android.os.Bundle
import android.util.Log
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.xui.android.adapter.BannerAdapter
import com.xuexiang.xui.widget.banner.recycler.BannerLayout
import com.xuexiang.xui.widget.dialog.DialogLoader


class MainActivity : AppCompatActivity() {
    private val imageList = ArrayList<String>()
    private var mAdapter: BannerAdapter? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        findViewById<Button>(R.id.showDialog).setOnClickListener {
            DialogLoader.getInstance().showTipDialog(
                this,
                "提示",
                "弹出对话框实例演示",
                "关闭"
            )
        }
        initPictures()//初始化图片数据
        var mBl = findViewById<BannerLayout>(R.id.bl)
        mAdapter = BannerAdapter(imageList)
        mBl.setAdapter(mAdapter)
    }
    /**
     * 图片初始化
     */
    private fun initPictures() {
        imageList.add("http://photocdn.sohu.com/tvmobilemvms/20150907/144160323071011277.jpg")
        imageList.add("http://photocdn.sohu.com/tvmobilemvms/20150907/144158380433341332.jpg")
        imageList.add("http://photocdn.sohu.com/tvmobilemvms/20150907/144160286644953923.jpg")
        imageList.add("http://photocdn.sohu.com/tvmobilemvms/20150902/144115156939164801.jpg")
        imageList.add("http://photocdn.sohu.com/tvmobilemvms/20150907/144159406950245847.jpg")
        Log.d("Test",imageList.toString())
    }
}